/**
 * Created by LINLA5 on 8/26/2016.
 */
/**
 * Created by LINLA5 on 8/24/2016.
 */
var config = require('./config')
var winston = require('winston');
var moment = require('moment');
//var file = require("../../../../log/iosc-info.log")
//console.log(config.logPath.info_file)
module.exports =  new (winston.Logger)({
    transports: [
        new (winston.transports.File)({
            name: 'info-file',
            filename: config.logPath.info_file,
            level: 'info',   //记录所有的
            timestamp: function () {
                return moment().format("LLLL");
            }
        }),
        new (winston.transports.File)({
            name: 'error-file',
            filename: config.logPath.error_file,
            level: 'error',
            timestamp: function () {
                return moment().format("LLLL")
            }
        }),
        new (winston.transports.Console)({
            level: 'info'
        })
    ],
    exceptionHandlers: [
        new (winston.transports.File)({
            name: 'exception-file',
            filename: config.logPath.exception_file,
            timestamp: function () {
                return moment().format("LLLL")
            }
        })
    ],
    exitOnError: false
})
console.log("in my winston")
//
//module.exports.error("hahahaha")
//module.exports.info("hahahaha")
//JSON.parse("name")

